<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>生命周期</title>
</head>
<body>
<div id="app">
  <child ref="child"></child>
</div>

<template id="child">
  <div>
    <li v-for="a in arr">{{a}}</li>
  </div>
</template>

</body>
<script src="../../node_modules/vue/dist/vue.js"></script>
<script>
  let child = {
    template:`#child`,
    data(){
      return {arr:[1,2,3]}
    },
    mounted(){
      this.arr=[4,5,6]
    }
  };

  let vm = new Vue({
    el: '#app',
    data: {
    },
    mounted(){
      this.$nextTick(()=>{
        console.log("nextTick 之后",this.$refs.child.$el.innerHTML);
      })
      console.log("nextTick 之前",this.$refs.child.$el.innerHTML);
    },
    components:{
      child
    }
  })

</script>
</html>
